<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.9.1.min.js"></script>
    <script>
        function fenye(cpage) {
            $("[name='cpage']").val(cpage);
            $("form").submit();
        }
    </script>
</head>
<body>
<form>
    <input type="hidden" name="page">
    姓名:<input type="text" name="mohu1" value="${map.mohu1}">
    <input type="submit">
</form>
<table>
    <tr>
        <td>编号</td>
        <td>名称</td>
        <td>价格</td>
        <td>图片</td>
        <td>仓库编号</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${pageInfo.list}" var="p">
        <tr>
            <td>${p.pid}</td>
            <td>${p.pname}</td>
            <td>${p.price}</td>
            <td>
                <img src="${p.image}" alt="无法展示">
            </td>
            <td>${p.bid}</td>
        </tr>
    </c:forEach>
    <tr>
        <td>
            <input type="button" value="首页" onclick="fenye(1)">
            <input type="button" value="上一页" onclick="fenye(${pageInfo.isFirstPage?1:pageInfo.prePage})">
            <input type="button" value="下一页" onclick="fenye(${pageInfo.isLastPage?pageInfo.pages:pageInfo.nextPage})">
            <input type="button" value="尾页" onclick="fenye(${pageInfo.pages})">
        </td>
    </tr>
</table>
</body>
</html>
